<template>
  <div class="mask">
    <div class="pop-wind">
      <div class="close-button" @click="$emit('hide')">×</div>
      <div class="head">{{ title }}</div>
      <div class="data-tag">{{ popData.dataTag }}</div>
      <div class="table">
        <div class="th">
          <div class="number">序号</div>
          <div class="name">设备</div>
          <div class="cop">{{ dataName }}</div>
        </div>
        <div class="tbody">
          <div v-for="(item, index) in popData.data" :key="index" class="tr">
            <div class="number">{{ index + 1 }}</div>
            <div class="name">{{ item && item.name ? item.name : '-' }}</div>
            <div class="cop">{{ item && item.value ? item.value : '-' }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    dataName: {
      type: String,
      default: ''
    },
    popData: {
      type: Object,
      default: () => {}
    }
  }
}
</script>

<style lang="scss" scoped>
.mask{
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pop-wind{
  width: 40%;
  max-height: 60%;
  padding: 2rem 3rem;
  background: rgb(13,28,69);
  border: 1px solid #00f4ff;
  display: flex;
  flex-flow: column;
  justify-content: space-around;
  position: relative;
}
.close-button{
  position: absolute;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 2.4rem;
  line-height: 2.6rem;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
}
.head{
  width: 100%;
  font-size: 2.4rem;
  font-weight: 600;
  text-align: center;
  margin: 1rem 0;
}
.data-tag{
  font-size: 1.4rem;
  color: #00f4ff;
  margin-bottom: 1rem;
}
.table{
  width: 100%;
  display: flex;
  flex-flow: column;
  overflow-y:scroll;
  // margin-top: 1rem;
  // 隐藏滚动条
  &::-webkit-scrollbar {// 兼容Chrome
    display: none;
  }
  &::-o-scrollbar {// 兼容Opera
    display: none;
  }
  scrollbar-width: none;// 兼容Firefox
  -ms-overflow-style: none;// 兼容edge
}
.tbody{
  width: 100%;
  max-height: 54rem;
  display: flex;
  flex-flow: column;
  overflow-y:scroll;
  // margin-top: 1rem;
  // 隐藏滚动条
  &::-webkit-scrollbar {// 兼容Chrome
    display: none;
  }
  &::-o-scrollbar {// 兼容Opera
    display: none;
  }
  scrollbar-width: none;// 兼容Firefox
  -ms-overflow-style: none;// 兼容edge
}
.table .tr{
  flex: 1;
  font-size: 1.5rem;
  display: flex;
}
.table .th{
  font-size: 1.5rem;
  display: flex;
  background: rgb(20,41,96);
}

.number,.name,.cop{
  flex: 1;
  text-align: center;
  padding: 0.7rem;
}
</style>
